home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / ghostscript / src / gstype1.h < prev    next >
C/C++ Source or Header  |  1994-08-01  |  4KB  |  114 lines

  1. /* Copyright (C) 1990, 1992 Aladdin Enterprises.  All rights reserved.
  2.  
  3. This file is part of Ghostscript.
  4.  
  5. Ghostscript is distributed in the hope that it will be useful, but
  6. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  7. to anyone for the consequences of using it or for whether it serves any
  8. particular purpose or works at all, unless he says so in writing.  Refer
  9. to the Ghostscript General Public License for full details.
  10.  
  11. Everyone is granted permission to copy, modify and redistribute
  12. Ghostscript, but only under the conditions described in the Ghostscript
  13. General Public License.  A copy of this license is supposed to have been
  14. given to you along with Ghostscript so you can know your rights and
  15. responsibilities.  It should be in a file named COPYING.  Among other
  16. things, the copyright notice and this notice must be preserved on all
  17. copies.  */
  18.  
  19. /* gstype1.h */
  20. /* Client interface to Adobe Type 1 font routines for Ghostscript library */
  21.  
  22. /* ------ Normal client interface ------ */
  23.  
  24. #define crypt_charstring_seed 4330
  25. typedef struct gs_type1_state_s gs_type1_state;
  26. extern const uint gs_type1_state_sizeof;
  27. #ifndef gs_show_enum_s_DEFINED
  28. struct gs_show_enum_s;
  29. #endif
  30. #ifndef gs_type1_data_s_DEFINED
  31. struct gs_type1_data_s;
  32. #endif
  33. int gs_type1_init(P5(gs_type1_state *pis, struct gs_show_enum_s *penum,
  34.           int charpath_flag, int paint_type,
  35.           struct gs_type1_data_s *pdata));
  36. /* Continue interpreting a Type 1 CharString. */
  37. /* If str != 0, it is taken as the byte string to interpret. */
  38. /* Return 0 on successful completion, <0 on error, */
  39. /* or >0 when client intervention is required. */
  40. /* The int * argument is where the character is stored for seac, */
  41. /* or the othersubr # for callothersubr. */
  42. #define type1_result_seac 1
  43. #define type1_result_callothersubr 2
  44. int gs_type1_interpret(P4(gs_type1_state *, const byte *, const gs_point *, int *));
  45. /* Pop a (fixed) number off the internal stack */
  46. int gs_type1_pop(P2(gs_type1_state *, fixed *));
  47.  
  48. /* ------ CharString representation ------ */
  49.  
  50. /* Define the charstring command set */
  51. typedef enum {
  52.         c_undef0 = 0,
  53.     c_hstem = 1,
  54.         c_undef2 = 2,
  55.     c_vstem = 3,
  56.     c_vmoveto = 4,
  57.     c_rlineto = 5,
  58.     c_hlineto = 6,
  59.     c_vlineto = 7,
  60.     c_rrcurveto = 8,
  61.     c_closepath = 9,
  62.     c_callsubr = 10,
  63.     c_return = 11,
  64.     c_escape = 12,            /* extends the command set */
  65.     c_hsbw = 13,
  66.     c_endchar = 14,
  67.     c_undoc15 = 15,            /* An obsolete and undocumented */
  68.                     /* 'moveto' command, */
  69.                     /* used in some Adobe fonts. */
  70.         c_undef16 = 16,
  71.         c_undef17 = 17,
  72.         c_undef18 = 18,
  73.         c_undef19 = 19,
  74.         c_undef20 = 20,
  75.     c_rmoveto = 21,
  76.     c_hmoveto = 22,
  77.         c_undef23 = 23,
  78.         c_undef24 = 24,
  79.         c_undef25 = 25,
  80.         c_undef26 = 26,
  81.         c_undef27 = 27,
  82.         c_undef28 = 28,
  83.         c_undef29 = 29,
  84.     c_vhcurveto = 30,
  85.     c_hvcurveto = 31
  86. } char_command;
  87. typedef enum {                /* extended commands */
  88.     ce_dotsection = 0,
  89.     ce_vstem3 = 1,
  90.     ce_hstem3 = 2,
  91.     ce_seac = 6,
  92.     ce_sbw = 7,
  93.     ce_div = 12,
  94.     ce_undoc15 = 15,        /* An obsolete and undocumented */
  95.                     /* 'addifgt' command, */
  96.                     /* used in some Adobe fonts. */
  97.     ce_callothersubr = 16,
  98.     ce_pop = 17,
  99.     ce_setcurrentpoint = 33
  100. } char_extended_command;
  101.  
  102. /* Define the encoding of numbers */
  103. #define c_num1 32
  104. #define c_value_num1(ch) ((int)(byte)(ch) - 139)
  105. #define c_num2 247
  106. #define c_value_num2(c1,c2)\
  107.   (((int)(byte)((c1) - c_num2) << 8) + (int)(byte)(c2) + 108)
  108. #define c_num3 251
  109. #define c_value_num3(c1,c2)\
  110.   -(((int)(byte)((c1) - c_num3) << 8) + (int)(byte)(c2) + 108)
  111. /* Otherwise, the first byte is 255, followed by a 32-bit 2's complement */
  112. /* number in big-endian order. */
  113. #define c_num4 255
  114.